import { App } from 'src/app.entity'
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm'
import { CalendarTypeEnum } from 'src/types/calendar'
import { Staff } from 'src/modules/staff/entities/staff.entity'
@Entity()
export class Calendar extends App {
  @Column({
    type: 'enum',
    enum: CalendarTypeEnum,
    default: CalendarTypeEnum['日程']
  })
  type: CalendarTypeEnum
  @Column({ type: 'varchar', length: 20 })
  title: string
  @Column({ type: 'varchar', length: 20, name: 'start_time' })
  startTime: string
  @Column({ type: 'varchar', length: 20, name: 'end_time', nullable: true })
  endTime?: string
  @Column({ type: 'varchar', length: 20, name: 'remind_time', nullable: true })
  remindTime?: string
  @Column({ type: 'varchar', length: 30, nullable: true })
  address?: string
  @Column({ type: 'varchar', length: 100, nullable: true })
  remark?: string
  @ManyToOne(() => Staff)
  @JoinColumn({ name: 'staff_id' })
  staff: Staff
}
